package cn.gov.ssxmzj.controller;


import cn.gov.ssxmzj.entry.Result;
import cn.gov.ssxmzj.service.MsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/msg")
public class MsgController {

    @Autowired
    private MsgService msgService;

    @ResponseBody
    @RequestMapping("/sendMsg")
    public Result sendMsg(String msgInfo,String msgType){
        return msgService.sendMsg(msgInfo,msgType);
    }

    @ResponseBody
    @RequestMapping("/getMsgNum")
    public Result getMsgNum(String managerId){
        return msgService.getMsgNum(managerId);
    }

    @ResponseBody
    @RequestMapping("/getMsgInfo")
    public Result getMsgInfo(String msgType,String isRead,String managerId,int page,int limit){
        return msgService.getMsgInfo(msgType,isRead,managerId,page,limit);
    }

    @ResponseBody
    @RequestMapping("/deleteMsg")
    public Result deleteMsg(String msgId,String managerId){
        return msgService.deleteMsg(msgId,managerId);
    }

    @ResponseBody
    @RequestMapping("/getOneMsgInfo")
    public Result getOneMsgInfo(String msgId,String managerId){
        return msgService.getOneMsgInfo(msgId,managerId);
    }

    @ResponseBody
    @RequestMapping("/readMsg")
    public Result readMsg(String msgId,String managerId){
        return msgService.readMsg(msgId,managerId);
    }
}
